﻿using System;
using System.Collections.Generic;
using Smart.Model;
using Smart.Business.Membership;

namespace Smart.Service
{
    /// <summary>
    /// Public Service implementation
    /// </summary>
    public class Membership : IMembership
    {
        #region Membership

        public List<User> GetUsers()
        {
            UserBL ubl = new UserBL();
            return ubl.GetUsers();
        }

        public bool ValidateUser(string email, string password)
        {
            UserBL ubl = new UserBL();
            return ubl.ValidateUser(email, password);
        }

        public User UpdateUser(User user)
        {
            UserBL ubl = new UserBL();
            return ubl.UpdateUser(user);
        }

        public User RegisterUser(User user)
        {
            UserBL ubl = new UserBL();
            return ubl.RegisterUser(user);
        }

        public User GetUserByEmail(string email)
        {
            UserBL ubl = new UserBL();
            return ubl.GetUserByEmail(email);
        }

        public User GetUserById(int userId)
        {
            UserBL ubl = new UserBL();
            return ubl.GetUserById(userId);
        }

        #endregion
    }
}
